<template>

   <div class="tablists">
        <el-table
          :data="tableData"
          :cell-style="$rowstyle"
          :header-cell-style="$headerstyle"
          style="width: 100%"
        >
          <el-table-column type="index" label="序号"  ></el-table-column>
          <el-table-column prop="payment_time" label="日期" >
            <template slot-scope="scope">{{transDate(scope.row.payment_time)}}</template>
          </el-table-column>
          <el-table-column v-if="type == 2 || type == 3" prop="item_status_text" label="项目" ></el-table-column>
          <el-table-column v-else prop="item_status.name" label="项目" ></el-table-column>
          <el-table-column prop="money" label="金额" ></el-table-column>
          <!-- <el-table-column prop="city" label="回款记录" ></el-table-column> -->
          <el-table-column label="操作" width="150">
            <template slot-scope="scope">
              <el-button @click="handleDelte(scope.row)" type="text" size="small">删除</el-button>
              <el-button type="text" @click="handleChange(scope.row)" size="small">变更</el-button>
              <!-- <el-button type="text" @click="handleLog(scope.row)" size="small">日志</el-button> -->
            </template>
          </el-table-column>
        </el-table>

      </div>

</template>

<script>

import moment from "moment";

export default {
  name: 'moneyList',
  props: ['tableData','type'],
  data() {
    return {
      visible: false,
      interval: null,
      isMoving: false
    }
  },
  mounted() {

  },
  beforeDestroy() {

  },
  methods: {
    transDate(time){
      return moment.unix(time).format("YYYY-MM-DD")
    },
    handleDelte(e){
      this.$emit('handleMoneyListDelete',e)
    },
    handleChange(e){
      this.$emit('handleMoneyListChange',e)
    },
    handleLog(e){

    }
  }
}
</script>

<style scoped>
.tablists {
    width: 95%;
    padding-left: 5%;
    margin-top: 20px;
  }
</style>
